package com.kw.serv.weixin;


import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import com.kw.serv.weixin.entry.WeiXinBaseBean;



public class WeiXinXMLHandler extends DefaultHandler{

	private WeiXinBaseBean weixin=null;
	private String processingElement=null;
	
	public void startDocument() throws SAXException { 
		weixin=new WeiXinBaseBean();
	}

	public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { 
		processingElement=qName;
	}
	 
	public void endElement(String uri, String localName, String qName) throws SAXException { 
		processingElement=null;
	}
	 
	public void characters(char[] ch, int start, int length) throws SAXException {
		if(processingElement!=null)	
		     weixin.add(processingElement, new String(ch,start,length));		 
	}
	
	public WeiXinBaseBean getWeiXinMessage(){
		return weixin;
	}
	
	
}
